package com.blog.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blog.entity.Article;

import java.util.List;
import java.util.Map;

public interface ArticleService {
    Article createArticle(Article article);
    
    Article updateArticle(Article article);
    
    void deleteArticle(Long id);
    
    Article findById(Long id);
    
    IPage<Article> findByCategory(Long categoryId, Page<Article> page);
    
    IPage<Article> findByUser(Long userId, Page<Article> page);
    
    IPage<Article> findAll(Page<Article> page, Integer status, Long userId, Long categoryId);
    
    void incrementViewCount(Long id);
    
    void updateStatus(Long id, Integer status);

    Long countAllArticles(Integer status, Long userId, Long categoryId);
    
    // 仪表盘相关统计方法
    Long count(Integer status);
    
    List<Map<String, Object>> findTopViewedArticles(Integer limit);
    
    List<Map<String, Object>> getCategoryArticleStats();
} 